package com.hy.hongying.vo;


import com.hy.hongying.config.SystemConfig;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class R {
    private int code;
    private String msg;
    private Object data;

    //成功
    public static R ok(Object obj){
        return new R(SystemConfig.R_OK,"OK",obj);
    }
    public static R ok(){
        return new R(SystemConfig.R_OK,"OK",null);
    }
    //失败
    public static R fail(String msg){
        return new R(SystemConfig.R_FAIL,msg,null);
    }
    public static R fail(){
        return new R(SystemConfig.R_FAIL,"FAIL",null);
    }

}
